/*
 * @Author: cjj
 * @Date: 2024-11-19 09:43:29
 * @LastEditors: cjj
 * @LastEditTime: 2024-11-19 10:21:54
 * @Description: 2901545842@qq.com
 */
import Mock from "mockjs";

//定义公里数
let { score } = Mock.mock({
    "score": "@integer(1000, 2000)"
});


//定义接口
//获取公里数
Mock.mock("/api/exchange/score", "post", ()=>{
    return {
        code: 200,
        data:score
    }
})
//消耗公里数
Mock.mock("/api/exchange/score/consume", "post", (req)=>{
   let { consume } = JSON.parse(req.body);
   console.log(consume);
   score -= consume;
    return {
        code: 200,
        data:score
    }
})
